package com.roden.ice.server;

public class IceServer extends Ice.Application{
	public static void main(String[] a) {
		IceServer app = new IceServer();
		String[] args={"",""};
		app.main("server", args);
	}

	public int run(String[] args) {
		int status=0;
		Ice.Communicator ic =null;
		try {
		ic=Ice.Util.initialize(args);
		Ice.ObjectAdapter adapter=ic.createObjectAdapterWithEndpoints("HelloWordldAdapter", "default -p 1888");
		Ice.Object object = new HelloWordldI();
		adapter.add(object, Ice.Util.stringToIdentity("HelloWordldService")); 
		
		adapter.activate();
		
		ic.waitForShutdown();
		
		} catch (Exception e) {
			status=1;
			
		}finally {
			if(ic!=null){
				ic.destroy();
			}
		}
		return status;
		
	}
}
